﻿/**********************************************************************
 * @file   OperFESubSystem.h
 * @brief  FE子系统操作器 - 创建，修改FE子系统的数据
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date   2024-12-21
 *********************************************************************/
#ifndef _OperatorsFESubSystem_H
#define _OperatorsFESubSystem_H

#include "FITK_Kernel/FITKCore/FITKActionOperator.h"
#include "FITK_Kernel/FITKCore/FITKOperatorRepo.h"
#include "FITK_Kernel/FITKCore/FITKThreadTask.h"

namespace Acoustics
{
    class FITKAbstractFESubSys;
    class FITKAbstractSEASubSys;
}
namespace Interface
{
    class FITKUnstructuredMesh;
}

namespace ModelOper
{
    /**
     * @brief 子系统创建操作器
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date   2024-10-23
     */
    class OperFESubSystem :public Core::FITKActionOperator
    {
        Q_OBJECT;
    public:
        /**
         * @brief Construct a new Operators Create SubSystem object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-10-23
         */
        explicit OperFESubSystem() = default;
        /**
         * @brief Destroy the Operators Create SubSystem object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-10-23
         */
        virtual ~OperFESubSystem() = default;
        /**
         * @brief 执行
         * @return true 成功
         * @return false 失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-10-23
         */
        virtual bool execGUI() override;
        /**
         * @brief 执行结果处理
         * @return true 成功
         * @return false 失败
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-10-23
         */
        virtual bool execProfession() override;

    protected:
        /**
         * @brief    创建操作
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-21
         */
        void createOper();
        /**
         * @brief    修改操作
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-21
         */
        void reviseOper();
        /**
         * @brief    获取拾取板的数据，生成网格
         * @param[i] obj 
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-27
         */
        bool structureFESubSysPickData(Acoustics::FITKAbstractFESubSys* obj);
        /**
         * @brief    获取拾取声腔的数据，生成网格
         * @param[i] obj 
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-27
         */
        bool acousticsFESubSysPickData(Acoustics::FITKAbstractFESubSys* obj);

    protected slots:
        /**
         * @brief  拾取完成，进行网格生成，并打开创建界面
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-27
         */
        void pickDataFinish();
    };

    // 按钮注册相关操作
    Register2FITKOperatorRepo(actionCreateStructFESubsys, OperFESubSystem);
    Register2FITKOperatorRepo(actionCreateAcousticFESubsys, OperFESubSystem);
    Register2FITKOperatorRepo(actionEditFESubsystem, OperFESubSystem);
}

#endif